跳到主要内容

SetStrikeout

Specifies that the contents of the run are displayed with a single horizontal line through the center of the line.

Syntax

expression.SetStrikeout(isStrikeout);

expression - A variable that represents a ApiRun class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isStrikeoutRequiredbooleanSpecifies that the contents of the current run are displayed struck through.

Returns

ApiTextPr

Example

This example specifies that the contents of the current run are displayed with a single horizontal line through the center of the line.

let doc = Api.GetDocument();
let textPr = doc.GetDefaultTextPr();
textPr.SetStrikeout(true);
let paragraph = doc.GetElement(0);
paragraph.AddText("A sample text struck out with a single line.");